﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
using System.Windows.Forms;

namespace QuadRemote.Panels
{
    class LogPanel : QuadPanel
    {
        private static LogPanel _instance = null;
        public static LogPanel instance()
        {
            if (_instance == null)
            {
                _instance = new LogPanel();
            }
            return _instance;
        }


        private RichTextBox textbox;

        protected LogPanel()
            : base("Log",200,300, Color.White,0)
        {

            textbox = new RichTextBox();
            textbox.Top = margin;
            textbox.Left = margin;
            textbox.BorderStyle = BorderStyle.None;
            textbox.BackColor = Color.Black;
            textbox.Width = PanelWidth;
            textbox.Height = PanelHeight;
            textbox.Multiline = true;
            textbox.ReadOnly = true;
            textbox.Font = new Font("Helvetica", 6);
            textbox.SelectionBullet = false;
            textbox.ScrollBars = RichTextBoxScrollBars.Vertical;
            textbox.ForeColor = Color.Yellow;
            textbox.Rtf = @"{\rtf1\ansi {\colortbl;\red255\green255\blue255;\red255\green0\blue0;}{\b\cf1 0:00}\cf2  test\par {\b\cf1 1:00}\cf2  test2}";
            textbox.SelectionColor = Color.Red;
            textbox.AppendText("\nTest");
            textbox.SelectionColor = Color.Yellow;
            textbox.AppendText("JALA JLA JLAJ L");
            drawingPanel.Controls.Add(textbox);
        }

        public override void resized()
        {
            if (textbox == null) return;
            textbox.Width = PanelWidth;
            textbox.Height = PanelHeight;
        }

        public override void PaintPanel(Graphics g)
        {
            
        }
    }
}
